package com.freesid.ask.client;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TextBox;

public class LoginPanel extends PopupPanel {

	public LoginPanel() {

		FlexTable table = new FlexTable();
		
		table.addStyleName("LoginPanel");
		InlineLabel title = new InlineLabel("Sign in");
		title.setStyleName("LoginPanelTitle");

		table.setWidget(table.getRowCount(), 0, title);

		table.setWidget(table.getRowCount(), 0, new InlineLabel("username"));
		table.setWidget(table.getRowCount(), 0, username);

		table.setWidget(table.getRowCount(), 0, new InlineLabel("password"));
		table.setWidget(table.getRowCount(), 0, password);

		table.setWidget(table.getRowCount(), 0, submitButton);

		form.add(table);
		setGlassStyleName("LoginPanel");
		setWidget(form);
		
	}

	private FormPanel form = new FormPanel();

	private TextBox username = new TextBox();

	private PasswordTextBox password = new PasswordTextBox();

	private Button submitButton = new Button("Submit");

	public FormPanel getForm() {
		return form;
	}

	public void setForm(FormPanel form) {
		this.form = form;
	}

	public TextBox getUsername() {
		return username;
	}

	public void setUsername(TextBox username) {
		this.username = username;
	}

	public PasswordTextBox getPassword() {
		return password;
	}

	public void setPassword(PasswordTextBox password) {
		this.password = password;
	}

	public Button getSubmitButton() {
		return submitButton;
	}

	public void setSubmitButton(Button submitButton) {
		this.submitButton = submitButton;
	}

}
